package com.da.javatest.interview.session1;

/**
 * @author chenlida
 * @date 2020/3/25 19:50
 * @description 就近原则，作用域
 */
public class Test06 {
    private static int s;
    private int i;
    private int j;

    {
        int i = 1;
        i++;
        j++;
        s++;
    }

    public void test(int j) {
        j++;
        i++;
        s++;
    }

    public static void main(String[] args) {
        Test06 t1 = new Test06();
        Test06 t2 = new Test06();
        t1.test(10);
        t1.test(20);
        t2.test(30);
        System.out.println(t1.i + "," + t1.j + "," + t1.s);
        System.out.println(t2.i + "," + t2.j + "," + t2.s);
    }
}
